home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / canvas.n < prev    next >
Text File  |  1994-09-20  |  82KB  |  1,783 lines

  1.  
  2.  
  3.  
  4. canvas(n)                  Tk Commands
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      canvas - Create and manipulate canvas widgets
  12.  
  13. SYNOPSIS
  14.      canvas _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16. STANDARD OPTIONS
  17.      background      insertBorderWidth              reliefxScrollCommand
  18.      borderWidth     insertOffTime  selectBackgroundyScrollCommand |
  19.      cursor          insertOnTime   selectBorderWidth              |
  20.      insertBackground               insertWidth     selectForeground|
  21.  
  22.      See the ``options'' manual entry for details on the standard
  23.      options.
  24.  
  25. WIDGET-SPECIFIC OPTIONS
  26.      Name:           closeEnough
  27.      Class:          CloseEnough
  28.      Command-Line Switch:-closeenough
  29.  
  30.           Specifies a floating-point value indicating  how  close
  31.           the  mouse  cursor must be to an item before it is con-
  32.           sidered to be ``inside'' the item.  Defaults to 1.0.
  33.  
  34.      Name:           confine                                       |
  35.      Class:          Confine                                       |
  36.      Command-Line Switch:-confine                                  |
  37.  
  38.                                                                         ||
  39.           Specifies a boolean value that indicates whether or not  |
  40.           it should be allowable to set the canvas's view outside  |
  41.           the   region  defined  by  the  scrollRegion  argument.  |
  42.           Defaults to true, which means that  the  view  will  be  |
  43.           constrained within the scroll region.
  44.  
  45.      Name:           height
  46.      Class:          Height
  47.      Command-Line Switch:-height
  48.  
  49.           Specifies a  desired  window  height  that  the  canvas
  50.           widget  should  request from its geometry manager.  The
  51.           value may be specified in any of the forms described in
  52.           the COORDINATES section below.
  53.  
  54.      Name:           scrollIncrement
  55.      Class:          ScrollIncrement
  56.      Command-Line Switch:-scrollincrement
  57.  
  58.           Specifies a distance used as  increment  during  scrol-
  59.           ling:   when  one of the arrow buttons on an associated
  60.  
  61.  
  62.  
  63. Tk                                                              1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. canvas(n)                  Tk Commands
  71.  
  72.  
  73.  
  74.           scrollbar is pressed, the picture will  shift  by  this
  75.           distance.   The distance may be specified in any of the
  76.           forms described in the COORDINATES section below.
  77.  
  78.      Name:           scrollRegion
  79.      Class:          ScrollRegion
  80.      Command-Line Switch:-scrollregion
  81.  
  82.           Specifies a list with four coordinates  describing  the
  83.           left, top, right, and bottom coordinates of a rectangu-
  84.           lar region.  This region is used for scrolling purposes
  85.           and is considered to be the boundary of the information
  86.           in the canvas.  Each of the coordinates may  be  speci-
  87.           fied  in any of the forms given in the COORDINATES sec-
  88.           tion below.
  89.  
  90.      Name:           width
  91.      Class:          width
  92.      Command-Line Switch:-width
  93.  
  94.           Specifies a desired window width that the canvas widget
  95.           should  request  from  its geometry manager.  The value
  96.           may be specified in any of the forms described  in  the
  97.           COORDINATES section below.
  98. _________________________________________________________________
  99.  
  100.  
  101. INTRODUCTION
  102.      The canvas command creates a new window (given by the  _p_a_t_h_-
  103.      _N_a_m_e  argument)  and  makes  it into a canvas widget.  Addi-
  104.      tional options, described above, may  be  specified  on  the
  105.      command  line or in the option database to configure aspects
  106.      of the canvas such as its colors and 3-D relief.  The canvas
  107.      command  returns  its  _p_a_t_h_N_a_m_e  argument.  At the time this
  108.      command is invoked, there must  not  exist  a  window  named
  109.      _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  110.  
  111.      Canvas widgets  implement  structured  graphics.   A  canvas
  112.      displays  any number of _i_t_e_m_s, which may be things like rec-
  113.      tangles, circles, lines, and text.  Items may be manipulated
  114.      (e.g.  moved  or  re-colored) and commands may be associated
  115.      with items in much the same way that the bind command allows
  116.      commands  to be bound to widgets.  For example, a particular
  117.      command may be associated with the <Button-1> event so  that
  118.      the command is invoked whenever button 1 is pressed with the
  119.      mouse cursor over an item.  This means that items in a  can-
  120.      vas  can  have behaviors defined by the Tcl scripts bound to
  121.      them.
  122.  
  123.  
  124. DISPLAY LIST
  125.  
  126.  
  127.  
  128.  
  129. Tk                                                              2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. canvas(n)                  Tk Commands
  137.  
  138.  
  139.  
  140.      The items in a canvas are ordered for purposes  of  display,
  141.      with  the  first  item  in  the display list being displayed
  142.      first, followed by the next item in the  list,  and  so  on.
  143.      Items  later in the display list obscure those that are ear-
  144.      lier in the display list and are sometimes  referred  to  as
  145.      being  ``on  top''  of  earlier  items.   When a new item is
  146.      created it is placed at the end of the display list, on  top
  147.      of  everything  else.   Widget  commands  may be used to re-
  148.      arrange the order of the display list.
  149.  
  150.  
  151. ITEM IDS AND TAGS
  152.      Items in a canvas widget may be named in either of two ways:
  153.      by  id or by tag.  Each item has a unique identifying number
  154.      which is assigned to that item when it is created.   The  id
  155.      of  an  item  never changes and id numbers are never re-used
  156.      within the lifetime of a canvas widget.
  157.  
  158.      Each item may also have any number of _t_a_g_s  associated  with
  159.      it.   A  tag is just a string of characters, and it may take
  160.      any form except that of an integer.  For  example,  ``x123''
  161.      is  OK  but  ``123''  isn't.  The same tag may be associated
  162.      with many different items.  This is commonly done  to  group
  163.      items   in  various  interesting  ways;   for  example,  all
  164.      selected items might be given the tag ``selected''.
  165.  
  166.      The tag all is implicitly associated with every item in  the
  167.      canvas;   it  may  be  used  to invoke operations on all the
  168.      items in the canvas.
  169.  
  170.      The tag current is managed automatically by Tk;  it  applies
  171.      to  the  _c_u_r_r_e_n_t _i_t_e_m, which is the topmost item whose drawn
  172.      area covers the position of the mouse cursor.  If the  mouse
  173.      is  not in the canvas widget or is not over an item, then no
  174.      item has the current tag.
  175.  
  176.      When specifying items in  canvas  widget  commands,  if  the
  177.      specifier  is  an integer then it is assumed to refer to the
  178.      single item with that  id.   If  the  specifier  is  not  an
  179.      integer,  then it is assumed to refer to all of the items in
  180.      the canvas that have a tag matching the specifier.  The sym-
  181.      bol  _t_a_g_O_r_I_d  is  used  below  to  indicate that an argument
  182.      specifies either an id that selects a single item or  a  tag
  183.      that  selects zero or more items.  Some widget commands only
  184.      operate on a single item at a time;  if _t_a_g_O_r_I_d is specified
  185.      in a way that names multiple items, then the normal behavior
  186.      is for the command to use the first (lowest) of these  items
  187.      in  the  display  list  that  is  suitable  for the command.
  188.      Exceptions are noted  in  the  widget  command  descriptions
  189.      below.
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Tk                                                              3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. canvas(n)                  Tk Commands
  203.  
  204.  
  205.  
  206. COORDINATES
  207.      All coordinates related to canvases are stored as  floating-
  208.      point  numbers.   Coordinates and distances are specified in
  209.      screen units, which are  floating-point  numbers  optionally
  210.      followed  by  one  of several letters.  If no letter is sup-
  211.      plied then the distance is in pixels.  If the  letter  is  m
  212.      then the distance is in millimeters on the screen;  if it is
  213.      c then the distance is in centimeters; i means inches, and p
  214.      means  printers  points  (1/72  inch).  Larger y-coordinates
  215.      refer to points lower on the screen;   larger  x-coordinates
  216.      refer to points farther to the right.
  217.  
  218.  
  219. TRANSFORMATIONS
  220.      Normally the origin of the canvas coordinate  system  is  at
  221.      the  upper-left  corner of the window containing the canvas.
  222.      It is possible to adjust the origin of the canvas coordinate
  223.      system  relative to the origin of the window using the xview
  224.      and yview widget  commands;   this  is  typically  used  for
  225.      scrolling.   Canvases  do not support scaling or rotation of
  226.      the canvas coordinate system relative to the window  coordi-
  227.      nate system.
  228.  
  229.      Indidividual items may be moved or scaled using widget  com-
  230.      mands described below, but they may not be rotated.
  231.  
  232.  
  233. INDICES
  234.      Text items support the notion of an  _i_n_d_e_x  for  identifying
  235.      particular  positions within the item.  Indices are used for
  236.      commands such as inserting text, deleting a range of charac-
  237.      ters,  and  setting the insertion cursor position.  An index
  238.      may be specified in any of a number of ways,  and  different
  239.      types  of  items  may support different forms for specifying
  240.      indices.  Text items support  the  following  forms  for  an
  241.      index;  if you define new types of text-like items, it would
  242.      be advisable to support as many of these forms as practical.
  243.      Note  that  it  is  possible  to refer to the character just
  244.      after the last one in the text item;  this is necessary  for
  245.      such tasks as inserting new text at the end of the item.
  246.  
  247.      _n_u_m_b_e_r    A  decimal  number  giving  the  position  of  the
  248.                desired  character within the text item.  0 refers
  249.                to the first character, 1 to the  next  character,
  250.                and  so on.  A number less than 0 is treated as if
  251.                it were zero, and a number greater than the length
  252.                of the text item is treated as if it were equal to
  253.                the length of the text item.
  254.  
  255.      end       Refers to the character just after the last one in
  256.                the  item (same as the number of characters in the
  257.                item).
  258.  
  259.  
  260.  
  261. Tk                                                              4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. canvas(n)                  Tk Commands
  269.  
  270.  
  271.  
  272.      insert    Refers to the  character  just  before  which  the  |
  273.                insertion cursor is drawn in this item.
  274.  
  275.      sel.first Refers to the  first  selected  character  in  the
  276.                item.   If  the  selection isn't in this item then
  277.                this form is illegal.
  278.  
  279.      sel.last  Refers to the last selected character in the item.
  280.                If the selection isn't in this item then this form
  281.                is illegal.
  282.  
  283.      @_x,_y      Refers to the character at the point  given  by  _x
  284.                and  _y, where _x and _y are specified in the coordi-
  285.                nate system of the canvas.  If _x and _y lie outside
  286.                the  coordinates  covered  by  the text item, then
  287.                they refer to the first or last character  in  the
  288.                line that is closest to the given point.
  289.  
  290.  
  291. WIDGET COMMAND
  292.      The canvas command creates a new Tcl command whose  name  is
  293.      _p_a_t_h_N_a_m_e.  This command may be used to invoke various opera-
  294.      tions on the widget.  It has the following general form:
  295.  
  296.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  297.  
  298.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the com-
  299.      mand.  The following widget commands are possible for canvas
  300.      widgets:
  301.  
  302.      _p_a_t_h_N_a_m_e addtag _t_a_g _s_e_a_r_c_h_S_p_e_c ?_a_r_g _a_r_g ...?
  303.           For each item that meets the constraints  specified  by
  304.           _s_e_a_r_c_h_S_p_e_c  and  the  _a_r_gs, add _t_a_g to the list of tags
  305.           associated with the item if it isn't already present on
  306.           that  list.   It is possible that no items will satisfy
  307.           the constraints given by _s_e_a_r_c_h_S_p_e_c _a_n_d _a_r_gs, in  which
  308.           case  the  command has no effect.  This command returns
  309.           an empty string as result.  _S_e_a_r_c_h_S_p_e_c  and  _a_r_g's  may
  310.           take any of the following forms:
  311.  
  312.           above _t_a_g_O_r_I_d
  313.                Selects the item just after (above) the one  given
  314.                by  _t_a_g_O_r_I_d  in  the  display  list.   If  _t_a_g_O_r_I_d
  315.                denotes more than one item, then  the  last  (top-
  316.                most) of these items in the display list is used.
  317.  
  318.           all  Selects all the items in the canvas.
  319.  
  320.           below _t_a_g_O_r_I_d
  321.                Selects the item just before (below) the one given
  322.                by  _t_a_g_O_r_I_d  in  the  display  list.   If  _t_a_g_O_r_I_d
  323.                denotes  more  than  one  item,  then  the   first
  324.                (lowest)  of  these  items  in the display list is
  325.  
  326.  
  327.  
  328. Tk                                                              5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. canvas(n)                  Tk Commands
  335.  
  336.  
  337.  
  338.                used.
  339.  
  340.           closest _x _y ?_h_a_l_o? ?_s_t_a_r_t?
  341.                Selects the item closest to the point given  by  _x
  342.                and  _y.   If  more  than  one  item is at the same
  343.                closest  distance  (e.g.  two  items  overlap  the
  344.                point), then the top-most of these items (the last
  345.                one in the display list)  is  used.   If  _h_a_l_o  is
  346.                specified,  then  it must be a non-negative value.
  347.                Any item closer than _h_a_l_o to  the  point  is  con-
  348.                sidered  to overlap it.  The _s_t_a_r_t argument may be
  349.                used to step circularly through  all  the  closest
  350.                items.   If  _s_t_a_r_t  is specified, it names an item
  351.                using a tag or id (if by tag, it selects the first
  352.                item  in  the  display  list  with the given tag).
  353.                Instead of selecting  the  topmost  closest  item,
  354.                this  form  will  select  the topmost closest item
  355.                that is below _s_t_a_r_t in the display  list;   if  no
  356.                such item exists, then the selection behaves as if
  357.                the _s_t_a_r_t argument had not been specified.
  358.  
  359.           enclosed _x_1 _y_1 _x_2 _y_2
  360.                Selects all the items completely  enclosed  within
  361.                the  rectangular  region  given by _x_1, _y_1, _x_2, and
  362.                _y_2.  _X_1 must be no greater then _x_2 and _y_1 must  be
  363.                no greater than _y_2.
  364.  
  365.           overlapping _x_1 _y_1 _x_2 _y_2
  366.                Selects all the items that overlap or are enclosed
  367.                within the rectangular region given by _x_1, _y_1, _x_2,
  368.                and _y_2.  _X_1 must be no greater then _x_2 and _y_1 must
  369.                be no greater than _y_2.
  370.  
  371.           withtag _t_a_g_O_r_I_d
  372.                Selects all the items given by _t_a_g_O_r_I_d.
  373.  
  374.      _p_a_t_h_N_a_m_e bbox _t_a_g_O_r_I_d ?_t_a_g_O_r_I_d _t_a_g_O_r_I_d ...?
  375.           Returns a list with four elements giving an approximate  |
  376.           bounding  box  for  all  the items named by the _t_a_g_O_r_I_d  |
  377.           arguments.  The list has the form ``_x_1 _y_1 _x_2 _y_2''  such  |
  378.           that  the  drawn  areas  of  all the named elements are  |
  379.           within the region bounded by _x_1 on the left, _x_2 on  the  |
  380.           right, _y_1 on the top, and _y_2 on the bottom.  The return  |
  381.           value may overestimate the actual bounding box by a few  |
  382.           pixels.  If no items match any of the _t_a_g_O_r_I_d arguments  |
  383.           then an empty string is returned.
  384.  
  385.      _p_a_t_h_N_a_m_e bind _t_a_g_O_r_I_d ?_s_e_q_u_e_n_c_e? ?_c_o_m_m_a_n_d?
  386.           This command associates  _c_o_m_m_a_n_d  with  all  the  items
  387.           given  by _t_a_g_O_r_I_d such that whenever the event sequence
  388.           given by _s_e_q_u_e_n_c_e occurs for one of the items the  com-
  389.           mand  will  be invoked.  This widget command is similar
  390.  
  391.  
  392.  
  393. Tk                                                              6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. canvas(n)                  Tk Commands
  401.  
  402.  
  403.  
  404.           to the bind command except that it operates on items in
  405.           a  canvas  rather  than  entire  widgets.  See the bind
  406.           manual entry for complete  details  on  the  syntax  of
  407.           _s_e_q_u_e_n_c_e  and  the  substitutions  performed on _c_o_m_m_a_n_d
  408.           before invoking it.  If  all  arguments  are  specified
  409.           then  a  new binding is created, replacing any existing
  410.           binding for the same _s_e_q_u_e_n_c_e and _t_a_g_O_r_I_d (if the first
  411.           character  of _c_o_m_m_a_n_d is ``+'' then _c_o_m_m_a_n_d augments an
  412.           existing binding rather than replacing  it).   In  this
  413.           case  the  return value is an empty string.  If _c_o_m_m_a_n_d
  414.           is omitted then the command returns the _c_o_m_m_a_n_d associ-
  415.           ated  with  _t_a_g_O_r_I_d  and  _s_e_q_u_e_n_c_e  (an error occurs if
  416.           there  is  no  such  binding).   If  both  _c_o_m_m_a_n_d  and
  417.           _s_e_q_u_e_n_c_e are omitted then the command returns a list of
  418.           all the sequences for which bindings have been  defined
  419.           for _t_a_g_O_r_I_d.
  420.  
  421.           The only events for which bindings may be specified are
  422.           those related to the mouse and keyboard, such as Enter,
  423.           Leave, ButtonPress, Motion, and KeyPress.  The handling
  424.           of  events in canvases uses the current item defined in
  425.           ITEM IDS  AND  TAGS  above.   Enter  and  Leave  events
  426.           trigger for an item when it becomes the current item or
  427.           ceases to be the current item;  note that these  events
  428.           are  different than Enter and Leave events for windows.
  429.           Mouse-related events are directed to the current  item,
  430.           if  any.   Keyboard-related  events are directed to the
  431.           focus item, if any (see the focus widget command  below
  432.           for more on this).
  433.  
  434.           It is possible for multiple commands to be bound  to  a
  435.           single  event  sequence  for  a  single  object.   This
  436.           occurs, for example, if one command is associated  with
  437.           the item's id and another is associated with one of the
  438.           item's tags.  When  this  occurs,  the  first  matching
  439.           binding  is  used.   A  binding  for  the item's id has
  440.           highest priority, followed by the oldest  tag  for  the
  441.           item  and  proceeding through all of the item's tags up
  442.           through the most-recently-added one.  If a  binding  is
  443.           associated  with  the  tag  all,  the binding will have
  444.           lower priority than all other bindings associated  with
  445.           the item.
  446.  
  447.      _p_a_t_h_N_a_m_e canvasx _s_c_r_e_e_n_x ?_g_r_i_d_s_p_a_c_i_n_g?
  448.           Given  a  screen  x-coordinate  _s_c_r_e_e_n_x  this   command
  449.           returns  the  canvas  x-coordinate that is displayed at
  450.           that location.  If _g_r_i_d_s_p_a_c_i_n_g is specified,  then  the
  451.           canvas coordinate is rounded to the nearest multiple of
  452.           _g_r_i_d_s_p_a_c_i_n_g units.
  453.  
  454.      _p_a_t_h_N_a_m_e canvasy _s_c_r_e_e_n_y ?_g_r_i_d_s_p_a_c_i_n_g?
  455.           Given  a  screen  y-coordinate  _s_c_r_e_e_n_y  this   command
  456.  
  457.  
  458.  
  459. Tk                                                              7
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. canvas(n)                  Tk Commands
  467.  
  468.  
  469.  
  470.           returns  the  canvas  y-coordinate that is displayed at
  471.           that location.  If _g_r_i_d_s_p_a_c_i_n_g is specified,  then  the
  472.           canvas coordinate is rounded to the nearest multiple of
  473.           _g_r_i_d_s_p_a_c_i_n_g units.
  474.  
  475.      _p_a_t_h_N_a_m_e configure ?_o_p_t_i_o_n? ?_v_a_l_u_e? ?_o_p_t_i_o_n _v_a_l_u_e ...?
  476.           Query  or  modify  the  configuration  options  of  the
  477.           widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  478.           describing all of the available  options  for  _p_a_t_h_N_a_m_e
  479.           (see  Tk_ConfigureInfo for information on the format of
  480.           this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  481.           the  command  returns  a  list describing the one named
  482.           option (this list will be identical to the  correspond-
  483.           ing  sublist  of  the  value  returned  if no _o_p_t_i_o_n is
  484.           specified).  If one  or  more  _o_p_t_i_o_n-_v_a_l_u_e  pairs  are
  485.           specified,  then  the command modifies the given widget
  486.           option(s) to have the given value(s);  in this case the
  487.           command  returns  an empty string.  _O_p_t_i_o_n may have any
  488.           of the values accepted by the canvas command.
  489.  
  490.      _p_a_t_h_N_a_m_e coords _t_a_g_O_r_I_d ?_x_0 _y_0 ...?
  491.           Query or modify the coordinates that  define  an  item.  |
  492.           If no coordinates are specified, this command returns a  |
  493.           list whose elements are the  coordinates  of  the  item  |
  494.           named  by  _t_a_g_O_r_I_d.  If coordinates are specified, then  |
  495.           they replace the  current  coordinates  for  the  named  |
  496.           item.   If  _t_a_g_O_r_I_d  refers to multiple items, then the  |
  497.           first one in the display list is used.
  498.  
  499.      _p_a_t_h_N_a_m_e create _t_y_p_e _x _y ?_x _y ...? ?_o_p_t_i_o_n _v_a_l_u_e ...?
  500.           Create a new item in _p_a_t_h_N_a_m_e of type _t_y_p_e.  The  exact
  501.           format of the arguments after type depends on type, but
  502.           usually they consist of the coordinates for one or more
  503.           points,  followed  by  specifications  for zero or more
  504.           item options.  See the subsections on  individual  item
  505.           types  below  for  more  on the syntax of this command.
  506.           This command returns the id for the new item.
  507.  
  508.      _p_a_t_h_N_a_m_e dchars _t_a_g_O_r_I_d _f_i_r_s_t ?_l_a_s_t?
  509.           For each item given by _t_a_g_O_r_I_d, delete  the  characters
  510.           in  the  range  given by _f_i_r_s_t and _l_a_s_t, inclusive.  If
  511.           some of the items given by _t_a_g_O_r_I_d don't  support  text
  512.           operations,  then they are ignored.  _F_i_r_s_t and _l_a_s_t are
  513.           indices of characters within the item(s)  as  described
  514.           in  INDICES  above.  If _l_a_s_t is omitted, it defaults to
  515.           _f_i_r_s_t.  This command returns an empty string.
  516.  
  517.      _p_a_t_h_N_a_m_e delete ?_t_a_g_O_r_I_d _t_a_g_O_r_I_d ...?
  518.           Delete each of the items given  by  each  _t_a_g_O_r_I_d,  and
  519.           return an empty string.                                  |
  520.  
  521.      _p_a_t_h_N_a_m_e dtag _t_a_g_O_r_I_d ?tagToDelete?
  522.  
  523.  
  524.  
  525. Tk                                                              8
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. canvas(n)                  Tk Commands
  533.  
  534.  
  535.  
  536.           For each of the items given by _t_a_g_O_r_I_d, delete the  tag
  537.           given  by _t_a_g_T_o_D_e_l_e_t_e from the list of those associated
  538.           with the item.  If an item doesn't have the tag  _t_a_g_T_o_-
  539.           _D_e_l_e_t_e  then the item is unaffected by the command.  If
  540.           _t_a_g_T_o_D_e_l_e_t_e is omitted then  it  defaults  to  _t_a_g_O_r_I_d.
  541.           This command returns an empty string.
  542.  
  543.      _p_a_t_h_N_a_m_e find _s_e_a_r_c_h_C_o_m_m_a_n_d ?_a_r_g _a_r_g ...?
  544.           This command returns a list consisting of all the items
  545.           that  meet  the  constraints specified by _s_e_a_r_c_h_C_o_m_m_a_n_d
  546.           and _a_r_g's.  _S_e_a_r_c_h_C_o_m_m_a_n_d and  _a_r_g_s  have  any  of  the
  547.           forms accepted by the addtag command.
  548.  
  549.      _p_a_t_h_N_a_m_e focus ?_t_a_g_O_r_I_d?
  550.           Set the keyboard focus for the  canvas  widget  to  the
  551.           item  given  by  _t_a_g_O_r_I_d.  If _t_a_g_O_r_I_d refers to several
  552.           items, then the focus is set to the first such item  in
  553.           the  display  list  that supports the insertion cursor.
  554.           If _t_a_g_O_r_I_d doesn't refer to any items, or  if  none  of
  555.           them support the insertion cursor, then the focus isn't
  556.           changed.  If _t_a_g_O_r_I_d is an empty string, then the focus
  557.           item  is  reset  so  that  no  item  has the focus.  If
  558.           _t_a_g_O_r_I_d is not specified then the command  returns  the
  559.           id  for  the  item  that currently has the focus, or an
  560.           empty string if no item has the focus.
  561.  
  562.           Once the focus has been set to an item, the  item  will
  563.           display  the  insertion  cursor and all keyboard events
  564.           will be directed to that item.  The focus item within a
  565.           canvas and the focus window on the screen (set with the
  566.           focus command) are totally independent:  a  given  item
  567.           doesn't  actually  have  the input focus unless (a) its
  568.           canvas is the focus window and  (b)  the  item  is  the
  569.           focus  item  within  the  canvas.   In most cases it is
  570.           advisable to follow the focus widget command  with  the
  571.           focus command to set the focus window to the canvas (if
  572.           it wasn't there already).
  573.  
  574.      _p_a_t_h_N_a_m_e gettags _t_a_g_O_r_I_d
  575.           Return a list whose elements are  the  tags  associated
  576.           with  the  item given by _t_a_g_O_r_I_d.  If _t_a_g_O_r_I_d refers to
  577.           more than one item, then the tags are returned from the
  578.           first  such  item  in  the  display  list.   If _t_a_g_O_r_I_d
  579.           doesn't refer to any items, or if the item contains  no
  580.           tags, then an empty string is returned.
  581.  
  582.      _p_a_t_h_N_a_m_e icursor _t_a_g_O_r_I_d _i_n_d_e_x
  583.           Set the  position  of  the  insertion  cursor  for  the  |
  584.           item(s)  given  by _t_a_g_O_r_I_d to just before the character  |
  585.           whose position is given by _i_n_d_e_x.  If some  or  all  of  |
  586.           the  items  given by _t_a_g_O_r_I_d don't support an insertion  |
  587.           cursor then this command has no effect  on  them.   See  |
  588.  
  589.  
  590.  
  591. Tk                                                              9
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. canvas(n)                  Tk Commands
  599.  
  600.  
  601.  
  602.           INDICES  above for a description of the legal forms for  |
  603.           _i_n_d_e_x.  Note:  the insertion cursor is  only  displayed  |
  604.           in  an  item  if  that  item currently has the keyboard  |
  605.           focus (see the widget command focus,  below),  but  the  |
  606.           cursor  position  may be set even when the item doesn't  |
  607.           have the focus.  This command returns an empty string.
  608.  
  609.      _p_a_t_h_N_a_m_e index _t_a_g_O_r_I_d _i_n_d_e_x
  610.           This command returns a decimal string giving the numer-
  611.           ical  index  within  _t_a_g_O_r_I_d  corresponding  to  _i_n_d_e_x.
  612.           _I_n_d_e_x gives a textual description of the desired  posi-
  613.           tion  as  described in INDICES above.  The return value
  614.           is guaranteed to lie between 0 and the number of  char-
  615.           acters  within  the item, inclusive.  If _t_a_g_O_r_I_d refers
  616.           to multiple items, then the index is processed  in  the
  617.           first  of these items that supports indexing operations
  618.           (in display list order).
  619.  
  620.      _p_a_t_h_N_a_m_e insert _t_a_g_O_r_I_d _b_e_f_o_r_e_T_h_i_s _s_t_r_i_n_g
  621.           For each of the items given by  _t_a_g_O_r_I_d,  if  the  item
  622.           supports  text  insertion  then _s_t_r_i_n_g is inserted into
  623.           the item's text just before the character  whose  index
  624.           is _b_e_f_o_r_e_T_h_i_s.  See INDICES above for information about
  625.           the forms allowed for _b_e_f_o_r_e_T_h_i_s.  This command returns
  626.           an empty string.
  627.  
  628.      _p_a_t_h_N_a_m_e itemconfigure _t_a_g_O_r_I_d  ?_o_p_t_i_o_n?  ?_v_a_l_u_e?  ?_o_p_t_i_o_n  _v_a_l_u_e
  629.           This command is similar to the configure widget command
  630.           except that it modifies item-specific options  for  the
  631.           items given by _t_a_g_O_r_I_d instead of modifying options for
  632.           the overall canvas widget.  If no _o_p_t_i_o_n is  specified,
  633.           returns  a list describing all of the available options
  634.           for   the   first   item   given   by   _t_a_g_O_r_I_d    (see
  635.           Tk_ConfigureInfo  for information on the format of this
  636.           list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then  the
  637.           command  returns a list describing the one named option
  638.           (this list will be identical to the corresponding  sub-
  639.           list  of the value returned if no _o_p_t_i_o_n is specified).
  640.           If one or more _o_p_t_i_o_n-_v_a_l_u_e pairs are  specified,  then
  641.           the command modifies the given widget option(s) to have
  642.           the given value(s)  in  each  of  the  items  given  by
  643.           _t_a_g_O_r_I_d;   in  this  case  the command returns an empty
  644.           string.  The _o_p_t_i_o_ns and _v_a_l_u_es are the same  as  those
  645.           permissible  in  the  create  widget  command  when the
  646.           item(s) were created; see the sections describing indi-
  647.           vidual  item  types  below  for  details  on  the legal
  648.           options.
  649.  
  650.      _p_a_t_h_N_a_m_e lower _t_a_g_O_r_I_d ?_b_e_l_o_w_T_h_i_s?
  651.           Move all of the items given by _t_a_g_O_r_I_d to a  new  posi-
  652.           tion  in the display list just before the item given by
  653.           _b_e_l_o_w_T_h_i_s.  If _t_a_g_O_r_I_d refers to  more  than  one  item
  654.  
  655.  
  656.  
  657. Tk                                                             10
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. canvas(n)                  Tk Commands
  665.  
  666.  
  667.  
  668.           then  all are moved but the relative order of the moved
  669.           items will not be changed.  _B_e_l_o_w_T_h_i_s is a tag  or  id;
  670.           if  it  refers  to  more  than  one item then the first
  671.           (lowest) of these items in the display list is used  as
  672.           the  destination  location  for  the moved items.  This
  673.           command returns an empty string.
  674.  
  675.      _p_a_t_h_N_a_m_e move _t_a_g_O_r_I_d _x_A_m_o_u_n_t _y_A_m_o_u_n_t
  676.           Move each of the items given by _t_a_g_O_r_I_d in  the  canvas
  677.           coordinate  space by adding _x_A_m_o_u_n_t to the x-coordinate
  678.           of each point associated with the item and  _y_A_m_o_u_n_t  to
  679.           the  y-coordinate  of  each  point  associated with the
  680.           item.  This command returns an empty string.
  681.  
  682.      _p_a_t_h_N_a_m_e postscript ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  683.           Generate a Postscript representation for part or all of  |
  684.           the  canvas.  If the -file option is specified then the  |
  685.           Postscript is written to a file and an empty string  is  |
  686.           returned;   otherwise the Postscript is returned as the  |
  687.           result of the command.  The Postscript  is  created  in  |
  688.           Encapsulated  Postscript  form using version 3.0 of the  |
  689.           Document  Structuring  Conventions.   The  _o_p_t_i_o_n-_v_a_l_u_e  |
  690.           argument  pairs  provide additional information to con-  |
  691.           trol  the  generation  of  Postscript.   The  following  |
  692.           options are supported:                                   |
  693.  
  694.           -colormap _v_a_r_N_a_m_e                                             ||
  695.                _V_a_r_N_a_m_e  must  be the name of a global array vari-  |
  696.                able that specifies a color mapping to use in  the  |
  697.                Postscript.   Each element of _v_a_r_N_a_m_e must consist  |
  698.                of Postscript code to set a particular color value  |
  699.                (e.g.  ``1.0 1.0 0.0 setrgbcolor'').  When output-  |
  700.                ting  color  information  in  the  Postscript,  Tk  |
  701.                checks  to  see  if there is an element of _v_a_r_N_a_m_e  |
  702.                with the same name as the color.  If so,  Tk  uses  |
  703.                the value of the element as the Postscript command  |
  704.                to set the color.   If  this  option  hasn't  been  |
  705.                specified,  or  if there isn't an entry in _v_a_r_N_a_m_e  |
  706.                for a given color, then Tk uses  the  red,  green,  |
  707.                and blue intensities from the X color.              |
  708.  
  709.           -colormode _m_o_d_e                                               ||
  710.                Specifies  how  to output color information.  _M_o_d_e  |
  711.                must be either color (for full color output), gray  |
  712.                (convert    all   colors   to   their   gray-scale  |
  713.                equivalents) or mono (convert all colors to  black  |
  714.                or white).                                          |
  715.  
  716.           -file _f_i_l_e_N_a_m_e                                                ||
  717.                Specifies  the  name of the file in which to write  |
  718.                the Postscript.  If this  option  isn't  specified  |
  719.                then  the  Postscript is returned as the result of  |
  720.  
  721.  
  722.  
  723. Tk                                                             11
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. canvas(n)                  Tk Commands
  731.  
  732.  
  733.  
  734.                the command instead of being written to a file.     |
  735.  
  736.           -fontmap _v_a_r_N_a_m_e                                              ||
  737.                _V_a_r_N_a_m_e  must  be the name of a global array vari-  |
  738.                able that specifies a font mapping to use  in  the  |
  739.                Postscript.   Each element of _v_a_r_N_a_m_e must consist  |
  740.                of a Tcl list with two  elements,  which  are  the  |
  741.                name  and  point  size of a Postscript font.  When  |
  742.                outputting Postscript commands  for  a  particular  |
  743.                font, Tk checks to see if _v_a_r_N_a_m_e contains an ele-  |
  744.                ment with the same name as the font.  If there  is  |
  745.                such  an  element,  then the font information con-  |
  746.                tained in that element is used in the  Postscript.  |
  747.                Otherwise  Tk  attempts  to  guess what Postscript  |
  748.                font to use.  Tk's guesses generally only work for  |
  749.                well-known  fonts  such as Times and Helvetica and  |
  750.                Courier, and only if the X font name does not omit  |
  751.                any  dashes  up through the point size.  For exam-  |
  752.                ple, -*-Courier-Bold-R-Normal--*-120-*  will  work  |
  753.                but   *Courier-Bold-R-Normal*120*  will  not;   Tk  |
  754.                needs the dashes to parse the font name).           |
  755.  
  756.           -height _s_i_z_e                                                  ||
  757.                Specifies  the height of the area of the canvas to  |
  758.                print.  Defaults to the height of the canvas  win-  |
  759.                dow.                                                |
  760.  
  761.           -pageanchor _a_n_c_h_o_r                                            ||
  762.                Specifies  which  point of the printed area should  |
  763.                be appear over the positioning point on  the  page  |
  764.                (which is given by the -pagex and -pagey options).  |
  765.                For example, -pageanchor  n  means  that  the  top  |
  766.                center  of  the  printed  area  should be over the  |
  767.                positioning point.  Defaults to center.             |
  768.  
  769.           -pageheight _s_i_z_e                                              ||
  770.                Specifies  that the Postscript should be scaled in  |
  771.                both x and y so that the printed area is _s_i_z_e high  |
  772.                on  the  Postscript  page.   _S_i_z_e  consists  of  a  |
  773.                floating-point number followed by c  for  centime-  |
  774.                ters,  i  for  inches,  m for millimeters, or p or  |
  775.                nothing  for   printer's   points   (1/72   inch).  |
  776.                Defaults  to the height of the printed area on the  |
  777.                screen.  If both -pageheight  and  -pagewidth  are  |
  778.                specified  then  the  scale  factor from the later  |
  779.                option is used (non-uniform scaling is not  imple-  |
  780.                mented).                                            |
  781.  
  782.           -pagewidth _s_i_z_e                                               ||
  783.                Specifies  that the Postscript should be scaled in  |
  784.                both x and y so that the printed area is _s_i_z_e wide  |
  785.                on the Postscript page.  _S_i_z_e has the same form as  |
  786.  
  787.  
  788.  
  789. Tk                                                             12
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. canvas(n)                  Tk Commands
  797.  
  798.  
  799.  
  800.                for -pageheight.  Defaults to  the  width  of  the  |
  801.                printed  area  on the screen.  If both -pageheight  |
  802.                and -pagewidth are specified then the scale factor  |
  803.                from the later option is used (non-uniform scaling  |
  804.                is not implemented).                                |
  805.  
  806.           -pagex _p_o_s_i_t_i_o_n                                               ||
  807.                _P_o_s_i_t_i_o_n gives the x-coordinate of the positioning  |
  808.                point on the Postscript page,  using  any  of  the  |
  809.                forms  allowed  for -pageheight.  Used in conjunc-  |
  810.                tion with the -pagey and  -pageanchor  options  to  |
  811.                determine  where  the  printed area appears on the  |
  812.                Postscript page.  Defaults to the  center  of  the  |
  813.                page.                                               |
  814.  
  815.           -pagey _p_o_s_i_t_i_o_n                                               ||
  816.                _P_o_s_i_t_i_o_n gives the y-coordinate of the positioning  |
  817.                point on the Postscript page,  using  any  of  the  |
  818.                forms  allowed  for -pageheight.  Used in conjunc-  |
  819.                tion with the -pagex and  -pageanchor  options  to  |
  820.                determine  where  the  printed area appears on the  |
  821.                Postscript page.  Defaults to the  center  of  the  |
  822.                page.                                               |
  823.  
  824.           -rotate _b_o_o_l_e_a_n                                               ||
  825.                _B_o_o_l_e_a_n  specifies  whether the printed area is to  |
  826.                be rotated 90 degrees.  In non-rotated output  the  |
  827.                x-axis  of  the  printed area runs along the short  |
  828.                dimension of the page (``portrait''  orientation);  |
  829.                in  rotated  output the x-axis runs along the long  |
  830.                dimension of the page (``landscape'' orientation).  |
  831.                Defaults to non-rotated.                            |
  832.  
  833.           -width _s_i_z_e                                                   ||
  834.                Specifies  the  width of the area of the canvas to  |
  835.                print.  Defaults to the width of the  canvas  win-  |
  836.                dow.                                                |
  837.  
  838.           -x _p_o_s_i_t_i_o_n                                                   ||
  839.                Specifies the x-coordinate of the left edge of the  |
  840.                area of the canvas that is to be printed, in  can-  |
  841.                vas coordinates, not window coordinates.  Defaults  |
  842.                to the coordinate of the left edge of the window.   |
  843.  
  844.           -y _p_o_s_i_t_i_o_n                                                   ||
  845.                Specifies  the y-coordinate of the top edge of the  |
  846.                area of the canvas that is to be printed, in  can-  |
  847.                vas coordinates, not window coordinates.  Defaults  |
  848.                to the coordinate of the top edge of the window.    |
  849.  
  850.      _p_a_t_h_N_a_m_e raise _t_a_g_O_r_I_d ?_a_b_o_v_e_T_h_i_s?
  851.           Move all of  the  items  given  by  _t_a_g_O_r_I_d  to  a  new
  852.  
  853.  
  854.  
  855. Tk                                                             13
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. canvas(n)                  Tk Commands
  863.  
  864.  
  865.  
  866.           position  in the display list just after the item given
  867.           by _a_b_o_v_e_T_h_i_s.  If _t_a_g_O_r_I_d refers to more than one  item
  868.           then  all are moved but the relative order of the moved
  869.           items will not be changed.  _A_b_o_v_e_T_h_i_s is a tag  or  id;
  870.           if  it refers to more than one item then the last (top-
  871.           most) of these items in the display list is used as the
  872.           destination location for the moved items.  This command
  873.           returns an empty string.
  874.  
  875.      _p_a_t_h_N_a_m_e scale _t_a_g_O_r_I_d _x_O_r_i_g_i_n _y_O_r_i_g_i_n _x_S_c_a_l_e _y_S_c_a_l_e
  876.           Rescale all of the items given  by  _t_a_g_O_r_I_d  in  canvas
  877.           coordinate  space.   _X_O_r_i_g_i_n  and  _y_O_r_i_g_i_n identify the
  878.           origin for the scaling operation and _x_S_c_a_l_e and  _y_S_c_a_l_e
  879.           identify  the  scale  factors for x- and y-coordinates,
  880.           respectively (a scale factor of 1.0 implies  no  change
  881.           to  that  coordinate).  For each of the points defining
  882.           each item, the x-coordinate is adjusted to  change  the
  883.           distance  from  _x_O_r_i_g_i_n  by  a factor of _x_S_c_a_l_e.  Simi-
  884.           larly, each y-coordinate is adjusted to change the dis-
  885.           tance from _y_O_r_i_g_i_n by a factor of _y_S_c_a_l_e.  This command
  886.           returns an empty string.
  887.  
  888.      _p_a_t_h_N_a_m_e scan _o_p_t_i_o_n _a_r_g_s
  889.           This command is used to implement scanning on canvases.
  890.           It has two forms, depending on _o_p_t_i_o_n:
  891.  
  892.           _p_a_t_h_N_a_m_e scan mark _x _y
  893.                Records _x and _y and  the  canvas's  current  view;
  894.                used  in  conjunction  with later scan dragto com-
  895.                mands.  Typically this command is associated  with
  896.                a mouse button press in the widget and _x and _y are
  897.                the coordinates of the mouse.  It returns an empty
  898.                string.
  899.  
  900.           _p_a_t_h_N_a_m_e scan dragto _x _y.
  901.                This command computes the difference between its _x
  902.                and _y arguments (which are typically mouse coordi-
  903.                nates) and the _x and _y arguments to the last  scan
  904.                mark  command for the widget.  It then adjusts the
  905.                view by 10 times the  difference  in  coordinates.
  906.                This  command  is  typically associated with mouse
  907.                motion events in the widget, to produce the effect
  908.                of  dragging  the canvas at high speed through its
  909.                window.  The return value is an empty string.
  910.  
  911.      _p_a_t_h_N_a_m_e select _o_p_t_i_o_n ?_t_a_g_O_r_I_d _a_r_g?
  912.           Manipulates the  selection  in  one  of  several  ways,
  913.           depending  on  _o_p_t_i_o_n.  The command may take any of the
  914.           forms described below.   In  all  of  the  descriptions
  915.           below,  _t_a_g_O_r_I_d  must  refer  to  an item that supports
  916.           indexing and selection;  if it refers to multiple items
  917.           then  the first of these that supports indexing and the
  918.  
  919.  
  920.  
  921. Tk                                                             14
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. canvas(n)                  Tk Commands
  929.  
  930.  
  931.  
  932.           selection is used.  _I_n_d_e_x gives a  textual  description
  933.           of  a  position within _t_a_g_O_r_I_d, as described in INDICES
  934.           above.
  935.  
  936.           _p_a_t_h_N_a_m_e select adjust _t_a_g_O_r_I_d _i_n_d_e_x
  937.                Locate the end of the selection in _t_a_g_O_r_I_d nearest
  938.                to  the  character given by _i_n_d_e_x, and adjust that
  939.                end of the selection to be at _i_n_d_e_x (i.e.  includ-
  940.                ing but not going beyond _i_n_d_e_x).  The other end of
  941.                the selection is made the anchor point for  future
  942.                select   to  commands.   If  the  selection  isn't
  943.                currently in _t_a_g_O_r_I_d then this command behaves the
  944.                same  as the select to widget command.  Returns an
  945.                empty string.
  946.  
  947.           _p_a_t_h_N_a_m_e select clear
  948.                Clear the selection if it is in this  widget.   If
  949.                the  selection  isn't in this widget then the com-
  950.                mand has no effect.  Returns an empty string.
  951.  
  952.           _p_a_t_h_N_a_m_e select from _t_a_g_O_r_I_d _i_n_d_e_x
  953.                Set the selection anchor point for the  widget  to
  954.                be just before the character given by _i_n_d_e_x in the
  955.                item  given  by  _t_a_g_O_r_I_d.   This  command  doesn't
  956.                change  the selection;  it just sets the fixed end
  957.                of the selection for future  select  to  commands.
  958.                Returns an empty string.
  959.  
  960.           _p_a_t_h_N_a_m_e select item
  961.                Returns the id of the selected item, if the selec-
  962.                tion  is in an item in this canvas.  If the selec-
  963.                tion is not in this canvas then an empty string is
  964.                returned.
  965.  
  966.           _p_a_t_h_N_a_m_e select to _t_a_g_O_r_I_d _i_n_d_e_x
  967.                Set the selection to consist of  those  characters
  968.                of  _t_a_g_O_r_I_d between the selection anchor point and
  969.                _i_n_d_e_x.  The new selection will include the charac-
  970.                ter  given by _i_n_d_e_x; it will include the character
  971.                given by the anchor point only if _i_n_d_e_x is greater
  972.                than  or  equal  to  the anchor point.  The anchor
  973.                point is determined  by  the  most  recent  select
  974.                adjust or select from command for this widget.  If
  975.                the selection anchor point for  the  widget  isn't
  976.                currently  in  _t_a_g_O_r_I_d, then it is set to the same
  977.                character  given  by  _i_n_d_e_x.   Returns  an   empty
  978.                string.
  979.  
  980.      _p_a_t_h_N_a_m_e type _t_a_g_O_r_I_d
  981.           Returns the type of the item given by _t_a_g_O_r_I_d, such  as
  982.           rectangle  or text.  If _t_a_g_O_r_I_d refers to more than one
  983.           item, then the type of the first item  in  the  display
  984.  
  985.  
  986.  
  987. Tk                                                             15
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. canvas(n)                  Tk Commands
  995.  
  996.  
  997.  
  998.           list  is  returned.   If  _t_a_g_O_r_I_d  doesn't refer to any
  999.           items at all then an empty string is returned.
  1000.  
  1001.      _p_a_t_h_N_a_m_e xview _i_n_d_e_x
  1002.           Change the view in the canvas so that the canvas  posi-
  1003.           tion  given  by  _i_n_d_e_x  appears at the left edge of the
  1004.           window.  This command is typically used  by  scrollbars
  1005.           to  scroll the canvas.  _I_n_d_e_x counts in units of scroll
  1006.           increments (the value of the  scrollIncrement  option):
  1007.           a value of 0 corresponds to the left edge of the scroll
  1008.           region (as defined  by  the  scrollRegion  option),   a
  1009.           value  of 1 means one scroll unit to the right of this,
  1010.           and so on.  The return value is an empty string.
  1011.  
  1012.      _p_a_t_h_N_a_m_e yview _i_n_d_e_x
  1013.           Change the view in the canvas so that the canvas  posi-
  1014.           tion given by _i_n_d_e_x appears at the top edge of the win-
  1015.           dow.  This command is typically used by  scrollbars  to
  1016.           scroll  the  canvas.   _I_n_d_e_x  counts in units of scroll
  1017.           increments (the value of the  scrollIncrement  option):
  1018.           a  value of 0 corresponds to the top edge of the scroll
  1019.           region (as defined  by  the  scrollRegion  option),   a
  1020.           value of 1 means one scroll unit below this, and so on.
  1021.           The return value is an empty string.
  1022.  
  1023.  
  1024. OVERVIEW OF ITEM TYPES
  1025.      The sections below describe the various types of items  sup-
  1026.      ported  by  canvas widgets.  Each item type is characterized
  1027.      by two things: first, the form of the create command used to
  1028.      create  instances  of the type;  and second, a set of confi-
  1029.      guration options for items of that type, which may  be  used
  1030.      in the create and itemconfigure widget commands.  Most items
  1031.      don't support indexing or selection or the commands  related
  1032.      to  them,  such as index and insert.  Where items do support
  1033.      these facilities, it is noted explicitly in the descriptions
  1034.      below (at present, only text items provide this support).
  1035.  
  1036.  
  1037. ARC ITEMS
  1038.      Items of type  arc  appear  on  the  display  as  arc-shaped  |
  1039.      regions.   An  arc  is a section of an oval delimited by two  |
  1040.      angles (specified by the -start  and  -extent  options)  and  |
  1041.      displayed  in  one  of several ways (specified by the -style  |
  1042.      option).  Arcs are created with widget commands of the  fol-  |
  1043.      lowing form:                                                  |
  1044.  
  1045.           _p_a_t_h_N_a_m_e create arc _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?|
  1046.  
  1047.      The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two  |
  1048.      diagonally  opposite corners of a rectangular region enclos-  |
  1049.      ing the oval that defines the arc.   After  the  coordinates  |
  1050.      there may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which  |
  1051.  
  1052.  
  1053.  
  1054. Tk                                                             16
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. canvas(n)                  Tk Commands
  1061.  
  1062.  
  1063.  
  1064.      sets one of the configuration options for the  item.   These  |
  1065.      same  _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in itemconfigure widget  |
  1066.      commands to change the item's configuration.  The  following  |
  1067.      options are supported for arcs:                               |
  1068.  
  1069.      -extent _d_e_g_r_e_e_s                                                    ||
  1070.           Specifies the size of the angular range occupied by the  |
  1071.           arc.  The  arc's  range  extends  for  _d_e_g_r_e_e_s  degrees  |
  1072.           counter-clockwise  from the starting angle given by the  |
  1073.           -start option.  _D_e_g_r_e_e_s may be negative.                 |
  1074.  
  1075.      -fill _c_o_l_o_r                                                        ||
  1076.           Fill  the region of the arc with _c_o_l_o_r.  _C_o_l_o_r may have  |
  1077.           any of the forms accepted by Tk_GetColor.  If _c_o_l_o_r  is  |
  1078.           an  empty  string (the default), then then the arc will  |
  1079.           not be filled.                                           |
  1080.  
  1081.      -outline _c_o_l_o_r                                                     ||
  1082.           _C_o_l_o_r  specifies  a  color to use for drawing the arc's  |
  1083.           outline;  it may have any  of  the  forms  accepted  by  |
  1084.           Tk_GetColor.   This  option  defaults to black.  If the  |
  1085.           arc's style is arc then this  option  is  ignored  (the  |
  1086.           section of perimeter is filled using the -fill option).  |
  1087.           If _c_o_l_o_r is specified as an empty string then  no  out-  |
  1088.           line is drawn for the arc.                               |
  1089.  
  1090.      -start _d_e_g_r_e_e_s                                                     ||
  1091.           Specifies  the  beginning of the angular range occupied  |
  1092.           by the arc.  _D_e_g_r_e_e_s is given in units of degrees meas-  |
  1093.           ured counter-clockwise from the 3-o'clock position;  it  |
  1094.           may be either positive or negative.                      |
  1095.  
  1096.      -stipple _b_i_t_m_a_p                                                    ||
  1097.           Indicates  that  the  arc should be filled in a stipple  |
  1098.           pattern; _b_i_t_m_a_p specifies the stipple pattern  to  use,  |
  1099.           in  any  of the forms accepted by Tk_GetBitmap.  If the  |
  1100.           -fill option hasn't been specified then this option has  |
  1101.           no effect.  If _b_i_t_m_a_p is an empty string (the default),  |
  1102.           then filling is done in a solid fashion.                 |
  1103.  
  1104.      -style _t_y_p_e                                                        ||
  1105.           Specifies  how  to  draw  the arc.  If _t_y_p_e is pieslice  |
  1106.           (the default) then the arc's region  is  defined  by  a  |
  1107.           section of the oval's perimeter plus two line segments,  |
  1108.           one between the center of the oval and each end of  the  |
  1109.           perimeter  section.   If  _t_y_p_e  is chord then the arc's  |
  1110.           region is defined by a section of the oval's  perimeter  |
  1111.           plus  a  single  line  segment  connecting  the two end  |
  1112.           points of the perimeter section.  If _t_y_p_e is  arc  then  |
  1113.           the arc's region consists of a section of the perimeter  |
  1114.           alone.  In this last case there is no outline  for  the  |
  1115.           arc and the -outline option is ignored.                  |
  1116.  
  1117.  
  1118.  
  1119. Tk                                                             17
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. canvas(n)                  Tk Commands
  1127.  
  1128.  
  1129.  
  1130.      -tags _t_a_g_L_i_s_t                                                      ||
  1131.           Specifies  a set of tags to apply to the item.  _T_a_g_L_i_s_t  |
  1132.           consists of a list of  tag  names,  which  replace  any  |
  1133.           existing  tags  for  the item.  _T_a_g_L_i_s_t may be an empty  |
  1134.           list.                                                    |
  1135.  
  1136.      -width _o_u_t_l_i_n_e_W_i_d_t_h                                                ||
  1137.           Specifies  the  width of the outline to be drawn around  |
  1138.           the arc's region, in any of the forms described in  the  |
  1139.           COORDINATES  section above.  If the -outline option has  |
  1140.           been specified as an empty string then this option  has  |
  1141.           no effect.  Wide outlines will be drawn centered on the  |
  1142.           edges of the arc's region.   This  option  defaults  to  |
  1143.           1.0.                                                     |
  1144.  
  1145.  
  1146. BITMAP ITEMS                                                       |
  1147.      Items of type bitmap appear on the display  as  images  with  |
  1148.      two  colors, foreground and background.  Bitmaps are created  |
  1149.      with widget commands of the following form:                   |
  1150.  
  1151.           _p_a_t_h_N_a_m_e create bitmap _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?|
  1152.  
  1153.      The arguments _x and _y specify the  coordinates  of  a  point  |
  1154.      used  to position the bitmap on the display (see the -anchor  |
  1155.      option  below  for  more  information  on  how  bitmaps  are  |
  1156.      displayed).   After  the coordinates there may be any number  |
  1157.      of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the  confi-  |
  1158.      guration  options  for  the  item.   These same _o_p_t_i_o_n-_v_a_l_u_e  |
  1159.      pairs may be used in itemconfigure widget commands to change  |
  1160.      the  item's  configuration.   The following options are sup-  |
  1161.      ported for bitmaps:                                           |
  1162.  
  1163.      -anchor _a_n_c_h_o_r_P_o_s                                                  ||
  1164.           _A_n_c_h_o_r_P_o_s  tells how to position the bitmap relative to  |
  1165.           the positioning point for the item;  it may have any of  |
  1166.           the  forms  accepted  by Tk_GetAnchor.  For example, if  |
  1167.           _a_n_c_h_o_r_P_o_s is center then the bitmap is centered on  the  |
  1168.           point;  if _a_n_c_h_o_r_P_o_s is n then the bitmap will be drawn  |
  1169.           so that its top center  point  is  at  the  positioning  |
  1170.           point.  This option defaults to center.                  |
  1171.  
  1172.      -background _c_o_l_o_r                                                  ||
  1173.           Specifies  a color to use for each of the bitmap pixels  |
  1174.           whose value is 0.  _C_o_l_o_r may  have  any  of  the  forms  |
  1175.           accepted  by  Tk_GetColor.  If this option isn't speci-  |
  1176.           fied, or if it is specified as an  empty  string,  then  |
  1177.           the background color for the canvas is used.             |
  1178.  
  1179.      -bitmap _b_i_t_m_a_p                                                     ||
  1180.           Specifies  the  bitmap  to display in the item.  _B_i_t_m_a_p  |
  1181.           may have any of the forms accepted by Tk_GetBitmap.      |
  1182.  
  1183.  
  1184.  
  1185. Tk                                                             18
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. canvas(n)                  Tk Commands
  1193.  
  1194.  
  1195.  
  1196.      -foreground _c_o_l_o_r                                                  ||
  1197.           Specifies  a color to use for each of the bitmap pixels  |
  1198.           whose value is 1.  _C_o_l_o_r may  have  any  of  the  forms  |
  1199.           accepted by Tk_GetColor and defaults to black.           |
  1200.  
  1201.      -tags _t_a_g_L_i_s_t                                                      ||
  1202.           Specifies  a set of tags to apply to the item.  _T_a_g_L_i_s_t  |
  1203.           consists of a list of  tag  names,  which  replace  any  |
  1204.           existing  tags  for  the item.  _T_a_g_L_i_s_t may be an empty  |
  1205.           list.
  1206.  
  1207.  
  1208. LINE ITEMS
  1209.      Items of type line appear on the display as one or more con-
  1210.      nected  line  segments  or  curves.   Lines are created with
  1211.      widget commands of the following form:
  1212.  
  1213.           _p_a_t_h_N_a_m_e create line _x_1 _y_1... _x_n _y_n ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  1214.  
  1215.      The arguments _x_1 through  _y_n  give  the  coordinates  for  a
  1216.      series  of two or more points that describe a series of con-
  1217.      nected line segments.  After the coordinates  there  may  be
  1218.      any  number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of
  1219.      the  configuration  options  for  the  item.    These   same
  1220.      _o_p_t_i_o_n-_v_a_l_u_e  pairs may be used in itemconfigure widget com-
  1221.      mands to change the  item's  configuration.   The  following
  1222.      options are supported for lines:
  1223.  
  1224.      -arrow _w_h_e_r_e
  1225.           Indicates whether or not arrowheads are to be drawn  at
  1226.           one  or  both ends of the line.  _W_h_e_r_e must have one of
  1227.           the values none (for  no  arrowheads),  first  (for  an
  1228.           arrowhead at the first point of the line), last (for an
  1229.           arrowhead at the last point of the line), or both  (for
  1230.           arrowheads  at  both  ends).   This  option defaults to
  1231.           none.
  1232.  
  1233.      -arrowshape _s_h_a_p_e
  1234.           This option indicates  how  to  draw  arrowheads.   The
  1235.           _s_h_a_p_e argument must be a list with three elements, each
  1236.           specifying a distance in any of the forms described  in
  1237.           the  COORDINATES  section  above.  The first element of
  1238.           the list gives the distance along  the  line  from  the
  1239.           neck  of  the arrowhead to its tip.  The second element
  1240.           gives the distance along the  line  from  the  trailing
  1241.           points  of the arrowhead to the tip, and the third ele-
  1242.           ment gives the distance from the outside  edge  of  the
  1243.           line  to  the  trailing  points.   If this option isn't
  1244.           specified then Tk picks a ``reasonable'' shape.
  1245.  
  1246.      -capstyle _s_t_y_l_e
  1247.           Specifies the ways in which caps are to be drawn at the
  1248.           endpoints of the line.  _S_t_y_l_e may have any of the forms
  1249.  
  1250.  
  1251.  
  1252. Tk                                                             19
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. canvas(n)                  Tk Commands
  1259.  
  1260.  
  1261.  
  1262.           accepted  by  Tk_GetCapStyle  (butt,   projecting,   or
  1263.           round).    If  this  option  isn't  specified  then  it
  1264.           defaults to butt.  Where arrowheads are drawn  the  cap
  1265.           style is ignored.
  1266.  
  1267.      -fill _c_o_l_o_r
  1268.           _C_o_l_o_r specifies a color to use for drawing the line; it
  1269.           may  have  any  of the forms acceptable to Tk_GetColor.
  1270.           It may also be an empty string, in which case the  line
  1271.           will be transparent.  This option defaults to black.
  1272.  
  1273.      -joinstyle _s_t_y_l_e
  1274.           Specifies the ways in which joints are to be  drawn  at
  1275.           the  vertices  of  the line.  _S_t_y_l_e may have any of the
  1276.           forms accepted  by  Tk_GetCapStyle  (bevel,  miter,  or
  1277.           round).    If  this  option  isn't  specified  then  it
  1278.           defaults to miter.   If  the  line  only  contains  two
  1279.           points then this option is irrelevant.
  1280.  
  1281.      -smooth _b_o_o_l_e_a_n
  1282.           _B_o_o_l_e_a_n  must  have  one  of  the  forms  accepted   by  |
  1283.           Tk_GetBoolean.   It  indicates  whether or not the line  |
  1284.           should be drawn as a curve.  If so, the  line  is  ren-  |
  1285.           dered  as  a set of Bezier splines: one spline is drawn  |
  1286.           for the first and second line  segments,  one  for  the  |
  1287.           second  and  third,  and so on.  Straight-line segments  |
  1288.           can be generated within  a  curve  by  duplicating  the  |
  1289.           end-points of the desired line segment.                  |
  1290.  
  1291.      -splinesteps _n_u_m_b_e_r                                                ||
  1292.           Specifies  the degree of smoothness desired for curves:  |
  1293.           each spline will be approximated with _n_u_m_b_e_r line  seg-  |
  1294.           ments.   This  option  is  ignored  unless  the -smooth  |
  1295.           option is true.
  1296.  
  1297.      -stipple _b_i_t_m_a_p
  1298.           Indicates that the line should be filled in  a  stipple
  1299.           pattern;  _b_i_t_m_a_p  specifies the stipple pattern to use,
  1300.           in any of the forms accepted by Tk_GetBitmap.  If  _b_i_t_-
  1301.           _m_a_p  is  an empty string (the default), then filling is
  1302.           done in a solid fashion.
  1303.  
  1304.      -tags _t_a_g_L_i_s_t
  1305.           Specifies a set of tags to apply to the item.   _T_a_g_L_i_s_t  |
  1306.           consists  of  a  list  of  tag names, which replace any  |
  1307.           existing tags for the item.  _T_a_g_L_i_s_t may  be  an  empty  |
  1308.           list.
  1309.  
  1310.      -width _l_i_n_e_W_i_d_t_h
  1311.           _L_i_n_e_W_i_d_t_h specifies the width of the line,  in  any  of
  1312.           the  forms  described in the COORDINATES section above.
  1313.           Wide lines will be drawn centered on the path specified
  1314.  
  1315.  
  1316.  
  1317. Tk                                                             20
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. canvas(n)                  Tk Commands
  1325.  
  1326.  
  1327.  
  1328.           by  the points.  If this option isn't specified then it
  1329.           defaults to 1.0.
  1330.  
  1331.  
  1332. OVAL ITEMS
  1333.      Items of type oval appear as circular or oval regions on the
  1334.      display.   Each  oval  may have an outline, a fill, or both.
  1335.      Ovals are created with  widget  commands  of  the  following
  1336.      form:
  1337.  
  1338.           _p_a_t_h_N_a_m_e create oval _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  1339.  
  1340.      The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two
  1341.      diagonally  opposite corners of a rectangular region enclos-
  1342.      ing the oval.  The oval will include the top and left  edges
  1343.      of  the  rectangle  not  the  lower  or right edges.  If the
  1344.      region is square then the resulting oval is circular; other-
  1345.      wise  it is elongated in shape.  After the coordinates there
  1346.      may be any number of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which  sets
  1347.      one  of  the configuration options for the item.  These same
  1348.      _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in itemconfigure widget  com-
  1349.      mands  to  change  the  item's configuration.  The following
  1350.      options are supported for ovals:
  1351.  
  1352.      -fill _c_o_l_o_r
  1353.           Fill the area of the oval with _c_o_l_o_r.  _C_o_l_o_r  may  have
  1354.           any  of the forms accepted by Tk_GetColor.  If _c_o_l_o_r is
  1355.           an empty string (the default), then then the oval  will
  1356.           not be filled.
  1357.  
  1358.      -outline _c_o_l_o_r
  1359.           _C_o_l_o_r specifies a color to use for drawing  the  oval's
  1360.           outline;   it  may  have  any  of the forms accepted by
  1361.           Tk_GetColor.  This option defaults to black.  If  _c_o_l_o_r
  1362.           is  an  empty  string then no outline will be drawn for
  1363.           the oval.
  1364.  
  1365.      -stipple _b_i_t_m_a_p
  1366.           Indicates that the oval should be filled in  a  stipple
  1367.           pattern;  _b_i_t_m_a_p  specifies the stipple pattern to use,
  1368.           in any of the forms accepted by Tk_GetBitmap.   If  the
  1369.           -fill option hasn't been specified then this option has
  1370.           no effect.  If _b_i_t_m_a_p is an empty string (the default),
  1371.           then filling is done in a solid fashion.
  1372.  
  1373.      -tags _t_a_g_L_i_s_t
  1374.           Specifies a set of tags to apply to the item.   _T_a_g_L_i_s_t  |
  1375.           consists  of  a  list  of  tag names, which replace any  |
  1376.           existing tags for the item.  _T_a_g_L_i_s_t may  be  an  empty  |
  1377.           list.
  1378.  
  1379.      -width _o_u_t_l_i_n_e_W_i_d_t_h
  1380.           _o_u_t_l_i_n_e_W_i_d_t_h specifies the width of the outline  to  be
  1381.  
  1382.  
  1383.  
  1384. Tk                                                             21
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. canvas(n)                  Tk Commands
  1391.  
  1392.  
  1393.  
  1394.           drawn around the oval, in any of the forms described in
  1395.           the COORDINATES section above.  If the -outline  option
  1396.           hasn't  been  specified then this option has no effect.  |
  1397.           Wide outlines are  drawn  centered  on  the  oval  path  |
  1398.           defined by _x_1, _y_1, _x_2, and _y_2.  This option defaults to
  1399.           1.0.
  1400.  
  1401.  
  1402. POLYGON ITEMS
  1403.      Items of type polygon appear as polygonal or  curved  filled
  1404.      regions  on  the  display.  Polygons are created with widget
  1405.      commands of the following form:
  1406.  
  1407.           _p_a_t_h_N_a_m_e create polygon _x_1 _y_1 ... _x_n _y_n ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  1408.  
  1409.      The arguments _x_1 through  _y_n  specify  the  coordinates  for
  1410.      three  or  more  points  that  define a closed polygon.  The
  1411.      first and last points may be the same;  whether they are  or
  1412.      not,  Tk  will  draw the polygon as a closed polygon.  After
  1413.      the coordinates there may  be  any  number  of  _o_p_t_i_o_n-_v_a_l_u_e
  1414.      pairs,  each  of which sets one of the configuration options
  1415.      for the item.  These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used  in
  1416.      itemconfigure  widget  commands  to change the item's confi-
  1417.      guration.  The following options are supported for polygons:
  1418.  
  1419.      -fill _c_o_l_o_r
  1420.           _C_o_l_o_r specifies a color to use for filling the area  of
  1421.           the polygon; it may have any of the forms acceptable to
  1422.           Tk_GetColor.  If _c_o_l_o_r is  an  empty  string  then  the
  1423.           polygon  will  be transparent.  This option defaults to
  1424.           black.
  1425.  
  1426.      -smooth _b_o_o_l_e_a_n
  1427.           _B_o_o_l_e_a_n  must  have  one  of  the  forms  accepted   by  |
  1428.           Tk_GetBoolean  It  indicates whether or not the polygon  |
  1429.           should be drawn with a curved perimeter.   If  so,  the  |
  1430.           outline of the polygon becomes a set of Bezier splines,  |
  1431.           one spline for the first and second line segments,  one  |
  1432.           for  the  second  and  third, and so on.  Straight-line  |
  1433.           segments can be generated  in  a  smoothed  polygon  by  |
  1434.           duplicating the end-points of the desired line segment.  |
  1435.  
  1436.      -splinesteps _n_u_m_b_e_r                                                ||
  1437.           Specifies  the degree of smoothness desired for curves:  |
  1438.           each spline will be approximated with _n_u_m_b_e_r line  seg-  |
  1439.           ments.   This  option  is  ignored  unless  the -smooth  |
  1440.           option is true.
  1441.  
  1442.      -stipple _b_i_t_m_a_p
  1443.           Indicates that the polygon should be filled in a  stip-
  1444.           ple  pattern;  _b_i_t_m_a_p  specifies the stipple pattern to
  1445.           use, in any of the forms accepted by Tk_GetBitmap.   If
  1446.           _b_i_t_m_a_p  is  an empty string (the default), then filling
  1447.  
  1448.  
  1449.  
  1450. Tk                                                             22
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. canvas(n)                  Tk Commands
  1457.  
  1458.  
  1459.  
  1460.           is done in a solid fashion.
  1461.  
  1462.      -tags _t_a_g_L_i_s_t
  1463.           Specifies a set of tags to apply to the item.   _T_a_g_L_i_s_t  |
  1464.           consists  of  a  list  of  tag names, which replace any  |
  1465.           existing tags for the item.  _T_a_g_L_i_s_t may  be  an  empty  |
  1466.           list.
  1467.  
  1468.  
  1469. RECTANGLE ITEMS
  1470.      Items of type rectangle appear as rectangular regions on the
  1471.      display.   Each  rectangle  may  have an outline, a fill, or
  1472.      both.  Rectangles are created with widget  commands  of  the
  1473.      following form:
  1474.  
  1475.           _p_a_t_h_N_a_m_e create rectangle _x_1 _y_1 _x_2 _y_2 ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  1476.  
  1477.      The arguments _x_1, _y_1, _x_2, and _y_2 give the coordinates of two
  1478.      diagonally  opposite corners of the rectangle (the rectangle
  1479.      will include its upper and left edges but not its  lower  or
  1480.      right edges).  After the coordinates there may be any number
  1481.      of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the  confi-
  1482.      guration  options  for  the  item.   These same _o_p_t_i_o_n-_v_a_l_u_e
  1483.      pairs may be used in itemconfigure widget commands to change
  1484.      the  item's  configuration.   The following options are sup-
  1485.      ported for rectangles:
  1486.  
  1487.      -fill _c_o_l_o_r
  1488.           Fill the area of the rectangle with _c_o_l_o_r, which may be
  1489.           specified  in any of the forms accepted by Tk_GetColor.
  1490.           If _c_o_l_o_r is an empty string (the  default),  then  then
  1491.           the rectangle will not be filled.
  1492.  
  1493.      -outline _c_o_l_o_r
  1494.           Draw an outline around the edge  of  the  rectangle  in
  1495.           _c_o_l_o_r.   _C_o_l_o_r  may  have  any of the forms accepted by
  1496.           Tk_GetColor.  This option defaults to black.  If  _c_o_l_o_r
  1497.           is  an  empty  string then no outline will be drawn for
  1498.           the rectangle.
  1499.  
  1500.      -stipple _b_i_t_m_a_p
  1501.           Indicates that the rectangle  should  be  filled  in  a
  1502.           stipple  pattern;  _b_i_t_m_a_p specifies the stipple pattern
  1503.           to use, in any of the forms accepted  by  Tk_GetBitmap.
  1504.           If  the  -fill  option  hasn't been specified then this
  1505.           option has no effect.  If _b_i_t_m_a_p  is  an  empty  string
  1506.           (the default), then filling is done in a solid fashion.
  1507.  
  1508.      -tags _t_a_g_L_i_s_t
  1509.           Specifies a set of tags to apply to the item.   _T_a_g_L_i_s_t  |
  1510.           consists  of  a  list  of  tag names, which replace any  |
  1511.           existing tags for the item.  _T_a_g_L_i_s_t may  be  an  empty  |
  1512.           list.
  1513.  
  1514.  
  1515.  
  1516. Tk                                                             23
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. canvas(n)                  Tk Commands
  1523.  
  1524.  
  1525.  
  1526.      -width _o_u_t_l_i_n_e_W_i_d_t_h
  1527.           _O_u_t_l_i_n_e_W_i_d_t_h specifies the width of the outline  to  be
  1528.           drawn  around  the  rectangle,  in  any  of  the  forms
  1529.           described in the COORDINATES  section  above.   If  the
  1530.           -outline  option hasn't been specified then this option
  1531.           has no effect.  Wide outlines are drawn centered on the  |
  1532.           rectangular  path  defined by _x_1, _y_1, _x_2, and _y_2.  This
  1533.           option defaults to 1.0.
  1534.  
  1535.  
  1536. TEXT ITEMS
  1537.      A text item displays a string of characters on the screen in
  1538.      one  or  more lines.  Text items support indexing and selec-
  1539.      tion, along with the following  text-related  canvas  widget
  1540.      commands:   dchars,  focus,  icursor, index, insert, select.  |
  1541.      Text items are created with widget commands of the following
  1542.      form:
  1543.  
  1544.           _p_a_t_h_N_a_m_e create text _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  1545.  
  1546.      The arguments _x and _y specify the  coordinates  of  a  point
  1547.      used  to  position  the text on the display (see the options
  1548.      below for more information on how text is displayed).  After
  1549.      the  coordinates  there  may  be  any number of _o_p_t_i_o_n-_v_a_l_u_e
  1550.      pairs, each of which sets one of the  configuration  options
  1551.      for  the item.  These same _o_p_t_i_o_n-_v_a_l_u_e pairs may be used in
  1552.      itemconfigure widget commands to change  the  item's  confi-
  1553.      guration.   The  following  options  are  supported for text
  1554.      items:
  1555.  
  1556.      -anchor _a_n_c_h_o_r_P_o_s
  1557.           _A_n_c_h_o_r_P_o_s tells how to position the  text  relative  to
  1558.           the positioning point for the text;  it may have any of
  1559.           the forms accepted by Tk_GetAnchor.   For  example,  if
  1560.           _a_n_c_h_o_r_P_o_s  is  center  then the text is centered on the
  1561.           point;  if _a_n_c_h_o_r_P_o_s is n then the text will  be  drawn
  1562.           such  that  the  top  center  point  of the rectangular
  1563.           region occupied by the text will be at the  positioning
  1564.           point.  This option defaults to center.
  1565.  
  1566.      -fill _c_o_l_o_r
  1567.           _C_o_l_o_r specifies a color to use  for  filling  the  text
  1568.           characters;  it  may  have any of the forms accepted by
  1569.           Tk_GetColor.  If this option isn't  specified  then  it
  1570.           defaults to black.
  1571.  
  1572.      -font _f_o_n_t_N_a_m_e
  1573.           Specifies the font to use for the text item.   _F_o_n_t_N_a_m_e
  1574.           may  be  any string acceptable to Tk_GetFontStruct.  If
  1575.           this option isn't specified, it defaults to  a  system-
  1576.           dependent font.
  1577.  
  1578.      -justify _h_o_w
  1579.  
  1580.  
  1581.  
  1582. Tk                                                             24
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. canvas(n)                  Tk Commands
  1589.  
  1590.  
  1591.  
  1592.           Specifies how to justify the text within  its  bounding
  1593.           region.   _H_o_w must be one of the values left, right, or
  1594.           center.  This option will only matter if  the  text  is
  1595.           displayed as multiple lines.  If the option is omitted,
  1596.           it defaults to left.
  1597.  
  1598.      -stipple _b_i_t_m_a_p
  1599.           Indicates that the text should be drawn in  a  stippled
  1600.           pattern rather than solid; _b_i_t_m_a_p specifies the stipple
  1601.           pattern to  use,  in  any  of  the  forms  accepted  by
  1602.           Tk_GetBitmap.   If  _b_i_t_m_a_p  is  an  empty  string  (the
  1603.           default) then the text is drawn in a solid fashion.
  1604.  
  1605.      -tags _t_a_g_L_i_s_t
  1606.           Specifies a set of tags to apply to the item.   _T_a_g_L_i_s_t  |
  1607.           consists  of  a  list  of  tag names, which replace any  |
  1608.           existing tags for the item.  _T_a_g_L_i_s_t may  be  an  empty  |
  1609.           list.
  1610.  
  1611.      -text _s_t_r_i_n_g
  1612.           _S_t_r_i_n_g specifies the characters to be displayed in  the
  1613.           text  item.  Newline characters cause line breaks.  The
  1614.           characters in the item may also  be  changed  with  the
  1615.           insert   and   delete  widget  commands.   This  option
  1616.           defaults to an empty string.
  1617.  
  1618.      -width _l_i_n_e_L_e_n_g_t_h
  1619.           Specifies a maximum line length for the text, in any of
  1620.           the  forms  described  in the COORDINATES section abov.
  1621.           If this option is zero (the default) the text is broken
  1622.           into  lines  only  at  newline characters.  However, if
  1623.           this option is non-zero then any  line  that  would  be
  1624.           longer  than  _l_i_n_e_L_e_n_g_t_h  is broken just before a space
  1625.           character to make the  line  shorter  than  _l_i_n_e_L_e_n_g_t_h;
  1626.           the  space character is treated as if it were a newline
  1627.           character.
  1628.  
  1629.  
  1630. WINDOW ITEMS
  1631.      Items of  type  window  cause  a  particular  window  to  be  |
  1632.      displayed  at  a given position on the canvas.  Window items  |
  1633.      are created with widget commands of the following form:       |
  1634.  
  1635.           _p_a_t_h_N_a_m_e create window _x _y ?_o_p_t_i_o_n _v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?|
  1636.  
  1637.      The arguments _x and _y specify the  coordinates  of  a  point  |
  1638.      used  to position the window on the display (see the -anchor  |
  1639.      option  below  for  more  information  on  how  bitmaps  are  |
  1640.      displayed).   After  the coordinates there may be any number  |
  1641.      of _o_p_t_i_o_n-_v_a_l_u_e pairs, each of which sets one of the  confi-  |
  1642.      guration  options  for  the  item.   These same _o_p_t_i_o_n-_v_a_l_u_e  |
  1643.      pairs may be used in itemconfigure widget commands to change  |
  1644.      the   item's   configuration.   The  following  options  are  |
  1645.  
  1646.  
  1647.  
  1648. Tk                                                             25
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. canvas(n)                  Tk Commands
  1655.  
  1656.  
  1657.  
  1658.      supported for window items:                                   |
  1659.  
  1660.      -anchor _a_n_c_h_o_r_P_o_s                                                  ||
  1661.           _A_n_c_h_o_r_P_o_s  tells how to position the window relative to  |
  1662.           the positioning point for the item;  it may have any of  |
  1663.           the  forms  accepted  by Tk_GetAnchor.  For example, if  |
  1664.           _a_n_c_h_o_r_P_o_s is center then the window is centered on  the  |
  1665.           point;  if _a_n_c_h_o_r_P_o_s is n then the window will be drawn  |
  1666.           so that its top center  point  is  at  the  positioning  |
  1667.           point.  This option defaults to center.                  |
  1668.  
  1669.      -height _p_i_x_e_l_s                                                     ||
  1670.           Specifies  the  height  to assign to the item's window.  |
  1671.           _P_i_x_e_l_s may have any of the forms described in the COOR-  |
  1672.           DINATES section above.  If this option isn't specified,  |
  1673.           or if it is specified as an empty string, then the win-  |
  1674.           dow is given whatever height it requests internally.     |
  1675.  
  1676.      -tags _t_a_g_L_i_s_t                                                      ||
  1677.           Specifies  a set of tags to apply to the item.  _T_a_g_L_i_s_t  |
  1678.           consists of a list of  tag  names,  which  replace  any  |
  1679.           existing  tags  for  the item.  _T_a_g_L_i_s_t may be an empty  |
  1680.           list.                                                    |
  1681.  
  1682.      -width _p_i_x_e_l_s                                                      ||
  1683.           Specifies  the  width  to  assign to the item's window.  |
  1684.           _P_i_x_e_l_s may have any of the forms described in the COOR-  |
  1685.           DINATES section above.  If this option isn't specified,  |
  1686.           or if it is specified as an empty string, then the win-  |
  1687.           dow is given whatever width it requests internally.      |
  1688.  
  1689.      -window _p_a_t_h_N_a_m_e                                                   ||
  1690.           Specifies  the window to associate with this item.  The  |
  1691.           window specified by _p_a_t_h_N_a_m_e must either be a child  of  |
  1692.           the  canvas  widget  or a child of some ancestor of the  |
  1693.           canvas widget.  _P_a_t_h_N_a_m_e may not refer to  a  top-level  |
  1694.           window.
  1695.  
  1696.  
  1697. APPLICATION-DEFINED ITEM TYPES
  1698.      It is possible for individual  applications  to  define  new
  1699.      item  types for canvas widgets using C code.  The interfaces
  1700.      for this mechanism are not presently  documented,  and  it's
  1701.      possible  they may change, but you should be able to see how
  1702.      they work by examining the code for  some  of  the  existing
  1703.      item types.
  1704.  
  1705.  
  1706. BINDINGS
  1707.      In the current implementation, new canvases  are  not  given
  1708.      any  default  behavior:  you'll have to execute explicit Tcl
  1709.      commands to give the canvas its behavior.
  1710.  
  1711.  
  1712.  
  1713. Tk                                                             26
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. canvas(n)                  Tk Commands
  1721.  
  1722.  
  1723.  
  1724. CREDITS
  1725.      Tk's canvas widget is a blatant ripoff of  ideas  from  Joel
  1726.      Bartlett's _e_z_d program.  _E_z_d provides structured graphics in
  1727.      a Scheme environment and preceded canvases by a year or two.
  1728.      Its  simple  mechanisms  for placing and animating graphical
  1729.      objects inspired the functions of canvases.
  1730.  
  1731.  
  1732. KEYWORDS
  1733.      canvas, widget
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779. Tk                                                             27
  1780.  
  1781.  
  1782.  
  1783.